from PIL import Image
from torch.utils.tensorboard import SummaryWriter
from torchvision import transforms

#hon
# transform.ToTensor
# 1.transform ruheshiyong
# 2.weismxuyao tensor

img_path = "../data/edata/train/bees/29494643_e3410f0d37.jpg"

img = Image.open(img_path)
print(img)



# shili yige ToTensor()duixiang
tensor_trans = transforms.ToTensor()
tensor_img = tensor_trans(img)
print(type(tensor_img))


writer = SummaryWriter("../logs")

writer.add_image("demo03_tensro_img",tensor_img)

writer.close()